/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2023-03-24
 * Time: 17:08
 */
public class ThreadDemo2 {
    public static void main(String[] args) {
        Thread tc=new Thread(()->{
            System.out.println(Thread.currentThread().getName());

        },"c");
        Thread tb=new Thread(()->{
            try {
                tc.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(Thread.currentThread().getName());

        },"b");
        Thread ta=new Thread(()->{
            try {
                tb.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(Thread.currentThread().getName());

        },"a");
        ta.start();
        tb.start();
        tc.start();

    }
}
